package com.sun.eureka.remoter;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sun.eureka.entry.Customer;
import com.sun.eureka.service.ICustomerService;

@RestController
public class CustomerRemoter {

	@Autowired
	private ICustomerService customerService;
	
	/**
	 * 根据id查询客户信息
	 * @param id
	 * @return
	 */
	@RequestMapping("customer/remoter/detail/{id}")
	public Customer get(@PathVariable("id") Long id) {
		Customer customer = customerService.get(id);
		Customer vo = new Customer();
		BeanUtils.copyProperties(customer, vo);
		return vo;
	}
}
